package seatiger.tomcat.catalina.connector;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 *
 */
public final class HttpResponseFacade<T extends HttpServletResponse>
        extends ResponseFacade
        implements HttpServletResponse{

    private T response;

    public HttpResponseFacade(T response) {
        super(response);
        this.response = response;
    }

    @Override
    public void addCookie(Cookie cookie) {
        response.addCookie(cookie);
    }

    @Override
    public boolean containsHeader(String name) {
        return response.containsHeader(name);
    }

    @Override
    public String encodeURL(String url) {
        return response.encodeURL(url);
    }

    @Override
    public String encodeRedirectURL(String url) {
        return response.encodeRedirectURL(url);
    }

    @Override
    public String encodeUrl(String url) {
        return response.encodeUrl(url);
    }

    @Override
    public String encodeRedirectUrl(String url) {
        return response.encodeRedirectUrl(url);
    }

    @Override
    public void sendError(int sc, String msg) throws IOException {
        response.sendError(sc,msg);
    }

    @Override
    public void sendError(int sc) throws IOException {
        response.sendError(sc);
    }

    @Override
    public void sendRedirect(String location) throws IOException {
        response.sendRedirect(location);
    }

    @Override
    public void setDateHeader(String name, long date) {
        response.setDateHeader(name,date);
    }

    @Override
    public void addDateHeader(String name, long date) {
        response.addDateHeader(name,date);
    }

    @Override
    public void setHeader(String name, String value) {
        response.setHeader(name,value);
    }

    @Override
    public void addHeader(String name, String value) {
        response.addHeader(name,value);
    }

    @Override
    public void setIntHeader(String name, int value) {
        response.setIntHeader(name,value);
    }

    @Override
    public void addIntHeader(String name, int value) {
        response.addIntHeader(name,value);
    }

    @Override
    public void setStatus(int sc) {
        response.setStatus(sc);
    }

    @Override
    public void setStatus(int sc, String msg) {
        response.setStatus(sc,msg);
    }
}
